<template>
  <div class="app-container">
    <el-table  :data="detailList" >
      <el-table-column label="记录单号" align="center" prop="id" width="120" fixed="left"/>
      <el-table-column label="记录时间" align="center" prop="recordTime" min-width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.recordTime) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="设备编号" align="center" prop="deviceId" min-width="160" />
      <el-table-column label="设备名称" align="center" prop="deviceName" min-width="180" />
      <el-table-column label="监测数值" align="center" prop="amount" min-width="160" />
    </el-table>
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
  </div>
</template>

<script>
import {storeMoveList} from "@/api/store/resource";
import {list} from "@/api/device/energy";
export default {
  name: "BaseDetail",
  dicts: ['sys_normal_disable'],
  data() {
    return {
      baseUrl: process.env.VUE_APP_BASE_API,
      detailList: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        deviceId: undefined,
      },
      // 总条数
      total: 0,
    };
  },
  created() {
    this.queryParams.deviceId = this.$route.query && this.$route.query.deviceId;
    this.getList();
  },
  methods: {
    /** 查询列表 */
    getList() {
      list(this.queryParams).then(response => {
        this.detailList = response.rows;
        this.total = response.total;
      });
    },
  }
};
</script>
